﻿using System;
using System.Globalization;
using BoxSauce.AgencyToolkit.Date;

namespace BoxSauce.AgencyToolkit.Extensions
{
    public static class DateExtensions
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="dateTime"></param>
        /// <param name="format"></param>
        /// <returns></returns>
        public static string ToString(this DateTime dateTime, DateTimeStringFormat format)
        {
            return Date.DateHelpers.StringFromPredefinedFormat(dateTime, format, CultureInfo.CurrentCulture);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="dateTime"></param>
        /// <param name="format"></param>
        /// <param name="culture"></param>
        /// <returns></returns>
        public static string ToString(this DateTime dateTime, DateTimeStringFormat format, CultureInfo culture)
        {
            return Date.DateHelpers.StringFromPredefinedFormat(dateTime, format, culture);
        }
    }
}
